<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>

<% content_for :page_title do %>
  /
  <%= I18n.t(:one, scope: "activerecord.models.spree/payment") %>
  /
  <%= payment_method_name(@payment) %>
  /
  <span class="state <%= @payment.state %>">
    <%= Spree.t(@payment.state, scope: :payment_states, default: @payment.state.capitalize) %>
  </span>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), icon: 'file.svg' %>
<% end %>

<%= render partial: "spree/admin/payments/source_views/#{@payment.payment_method.method_type}",
           locals: {
             payment: @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment
           } %>

<div class="alert alert-success" data-hook="amount">
  <%= Spree.t(:amount) %>: <%= @payment.display_amount.to_html %>
</div>

<%= render 'spree/admin/payments/capture_events' %>
